package threadException;

import java.util.concurrent.TimeUnit;

public class ThreadException1 {
    /**
     * 子方法异常程序终止
     * @param args
     * @throws InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {
        System.out.println("主线程开始");
        test();
        TimeUnit.SECONDS.sleep(2);
        System.out.println("主线程截至");
    }
    public static void test() {
        System.out.println("子方法开始");
        int i = 1/0;
        System.out.println("子方法结束");
    }
}
